const Router = require('koa-router');
const { HttpException, ParameterException } = require('../../../core/httpException');

const router = new Router();

router.post('/classic/:id/latest', (ctx,next) => {
  const path = ctx.params;
  const query = ctx.request.query;
  const headers = ctx.request.header;
  const body = ctx.request.body;

  ctx.body = {key: "classic"}

/*  if (true) {
    let error = new Error("没有传递参数！");
    error.errorCode = 10001;
    error.requestUrl = `${ctx.method} ${ctx.path}`;
    error.status = 400;
    throw error
  }*/

  // 优化error
  if (true) {
    throw new ParameterException();
  }

});


module.exports = router;